package br.com.ufrn.aipetro.ga.domain.entity.device.sensor.sensortemperature;

import java.util.Date;

import br.com.ufrn.aipetro.ga.domain.entity.device.Critical;
import br.com.ufrn.aipetro.ga.domain.entity.device.OperationStatus;
import br.com.ufrn.aipetro.ga.domain.entity.device.Protocol;
import br.com.ufrn.aipetro.ga.domain.entity.device.sensor.Sensor;
import br.com.ufrn.aipetro.ga.domain.entity.mesh.Mesh;

public class SensorTemperature extends Sensor {
	
	public static final String TEMPERATURE_MAX_PROPERTY = "temperatureMax";
	public static final String TEMPERATURE_MIN_PROPERTY = "temperatureMin";
	
	private float temperatureMax;
	private float temperatureMin;
	
	/**
	 * 
	 */
	public SensorTemperature() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	
	
	/**
	 * @param name
	 * @param operationTemperature
	 * @param range
	 * @param sampleRate
	 * @param deviceId
	 * @param serialNumber
	 * @param model
	 * @param manufacturer
	 * @param mesh
	 * @param tag
	 * @param operationStatus
	 * @param protocol
	 * @param critical
	 * @param dateOperationStart
	 * @param dateOperationFinish
	 */
	public SensorTemperature(float temperatureMin, float temperatureMax, String name, 
			float operationTemperature,
			float range, float sampleRate, String deviceId,
			String serialNumber, String model, String manufacturer, Mesh mesh,
			String tag, OperationStatus operationStatus, Protocol protocol,
			Critical critical, Date dateOperationStart, Date dateOperationFinish) {
		
		
		super(name, operationTemperature, range, sampleRate, deviceId, serialNumber,
				model, manufacturer, mesh, tag, operationStatus, protocol, critical,
				dateOperationStart, dateOperationFinish);

		this.temperatureMin = temperatureMin;
		this.temperatureMax = temperatureMax;
	}



	/**
	 * @return the temperatureMax
	 */
	public float getTemperatureMax() {
		return temperatureMax;
	}



	/**
	 * @param temperatureMax the temperatureMax to set
	 */
	public void setTemperatureMax(float temperatureMax) {		
		float oldTemperatureMax = this.temperatureMax;
		this.temperatureMax = temperatureMax;
		
		firePropertyChange(TEMPERATURE_MAX_PROPERTY, oldTemperatureMax, temperatureMax);
	}

	/**
	 * @return the temperatureMin
	 */
	public float getTemperatureMin() {
		return temperatureMin;
	}


	/**
	 * @param temperatureMin the temperatureMin to set
	 */
	public void setTemperatureMin(float temperatureMin) {
		float oldTemperatureMin = this.temperatureMin;
		this.temperatureMin = temperatureMin;
		
		firePropertyChange(TEMPERATURE_MIN_PROPERTY, oldTemperatureMin, temperatureMin);
	}
}
